package raft

//
// example RequestVote RPC arguments structure.
// field names must start with capital letters!
//
type RequestVoteArgs struct {
	// 候选人任期
	Term int
	// 当前服务器 id
	CandidateId int
	// Your data here (2A, 2B).
	LastLogIndex int
	LastLogTerm  int
}

//
// example RequestVote RPC reply structure.
// field names must start with capital letters!
//
type RequestVoteReply struct {
	// 对等方更新的任期
	Term int
	// 对等方是否同意本次投票
	VoteGranted bool
}

type AppendEntriesArgs struct {
	Term     int
	LeaderId int

	PrevLogIndex int
	PrevLogTerm  int
	Entries      []Log
	LeaderCommit int
}

type AppendEntriesReply struct {
	Term         int
	Success      bool
	Server       int
	PrevLogIndex int
	EntriesLen   int
}
